{% load tasks_tags %}
{% load group_tags %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}" xml:lang="{{ LANGUAGE_CODE }}" lang="{{ LANGUAGE_CODE }}">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>Tasks</title>
        <!--[if IE]><style>
            div {
                zoom: 1; /* trigger hasLayout */
            }
        </style><![endif]-->
        <link rel="stylesheet" href="{{ STATIC_URL }}pinax/css/base.css" />
        <link rel="stylesheet" href="{{ STATIC_URL }}tasks/css/tasks.css" />
        <style>
            body {
                padding: 5px;
            }
            h1 {
                font-size: 12pt;
                margin: 0 0 5px;
            }
        </style>
    </head>
    
    <body>
        
        <h1>Open Assigned Tasks</h1>
        
        {% if assigned_tasks %}
            {% regroup assigned_tasks by get_state_display as grouped_tasks %}
            <table class="task_list">
                <tr>
                    <th>ID</th>
                    <th>Summary</th>
                </tr>
                {% for section in grouped_tasks %}
                    <tbody><tr class="task_grouping">
                        <td colspan="5">
                            <span class="toggle">
                                <span class="arrow">&#x25BE;</span>
                                {{ section.grouper }}
                                <span class="count">({{ section.list|length }})</span>
                            </span>
                        </td>
                    </tr></tbody>
                    <tbody class="task_group" id="group_{{ forloop.counter }}">
                        {% for task in section.list %}
                            <tr class="task_{{ task.get_state_display }} {% cycle odd,even %}">
                                <td>{{ task.id }}</td>
                                <td><a href="{% groupurl task_detail group id=task.id %}" target="_blank">{{ task.summary }}</a></td>
                            </tr>
                        {% endfor %}
                    </tbody>
                {% endfor %}
            </table>
        {% else %}
            <p>You have no assigned tasks right now.</p>
        {% endif %}
        <script src="{{ STATIC_URL }}pinax/js/jquery-1.3.2.min.js" type="text/javascript"></script>
        <script src="{{ STATIC_URL }}tasks/js/tasks.js" type="text/javascript"></script>
    </body>
</html>
